The present invention relates to the field of computer data file systems, and more particularly to an implementation, with expandable storage size for control information, that allows for the efficient access of extended attributes without compatibility problems.
Computer operating systems, e.g., DOS and Unix, and the mechanism for creating, storing and retrieving data files and directories associated with the operating systems are generally well known. A file system is a collection of management structures which impose a logical structure upon a storage device, typically a disk storage device, in order to let an arbitrary set of users construct and store files of user data in a way that allows later retrieval of that data using file names. File systems have evolved which allow the application programmer to focus on the functionality of the application program thereby leaving the operating system the task of creating files and directories, allocating disk space and file retrieval schemes.
Typically, an operating system, in response to a function call from an application, creates a file for the data retrieved, e.g., text, graphics, video, from the memory and stores the data at a specific location within a data storage unit, e.g., hard drive, file server. Furthermore, the operating system typically stores a set of information commonly referred to as standard attributes, e.g., file name, data and time of most recent access to file, date and time of last revision, size, location, creator, access control information, in an inode. An inode may be a particular block or structure in a file system. Inodes stored on a disk, e.g., hard drive, are commonly referred to as dinodes. A file system object is typically associated with a particular dinode. The particular dinode comprises access control information which must be read first in order to access the file system object associated with that particular dinode.
As application programs have become more complex, the operating system is required to track other information which may be referred to as extended attributes. Although these extended attributes may be included in the list of standard attributes, it would unnecessarily increase the size and complexity of the set of standard attributes because many extended attributes are application program specific.
Prior art file systems reserve specific fields for each specific extended attribute in the dinode representing the file system object, e.g., files, directories or links, to an application, e.g., a database unaware application. These fields store extended attribute data if the amount of extended attribute data is small or stores a pointer which points to a storage address of the extended attribute data outside the dinode. Unfortunately, these dinode structures are fixed in size which limits the amount of control information, e.g., the types of extended attributes, that maybe stored in the dinode of the file system object. Furthermore, the replacement of control information, e.g., extended attribute types, requires the modification of the dinode structure which results in compatibility problems in successive versions of the file system.
Prior art file systems avoid the limitation problem of the dinode by using a single field to store a pointer which points to a single, variable byte stream where each extended attribute is stored as a substring of the extended attribute string. This results in a very inefficient update problem when extended attributes are either modified or deleted since the extended attribute string must be reconstructed to accommodate the changed size of the substring of the specific extended attribute. Furthermore, summary information of the extended attributes, e.g., number of extended attribute types, requires reading the summary information of each substring along the entire extended attribute string. This is a very inefficient process.
It would therefore be desirable to develop an implementation that allows for efficient access to extended attributes including summary information without any compatibility problems. It would further be desirable to allow for an expandable storage size of control information without any compatibility problems.
The problems outlined above may at least in part be solved in some embodiments by providing a one-to-one mapping between dinodes within a dinode page and dinodexes within a dinodex page. Standard attributes associated with file system objects are stored in dinodes which are stored on a disk storage device, e.g., hard drive, disk units. Extended attributes associated with file system objects are stored in dinodexes which are stored on a disk storage device, e.g., disk units. Each dinode comprises a plurality of fields where one of the plurality of fields comprises an extended attribute descriptor. An extended attribute descriptor points to the associated dinodex if there exists an extended attribute associated with the file system object, i.e., file system object associated with the dinode comprising the extended attribute descriptor in question. However, if there is no extended attributed associated with the file system object, i.e., file system object associated with the dinode comprising the extended attribute descriptor in question, then the extended attribute descriptor comprises a value of null and does not point to an associated dinodex.
In one embodiment, a method for efficiently accessing extended attributes comprises the step of determining whether a particular file system object has an extended attribute data associated with the particular file system object. This is accomplished by reading an extended attribute descriptor in a particular dinode associated with the particular file system object. The particular dinode is located within a dinode page. The method further comprises the step of reading a particular dinodex to access the extended attribute data associated with the particular file system object if the particular file system object has extended attribute data associated with it. The particular dinodex is associated with the particular dinode.
In another embodiment of the present invention, the dinodex page comprises at least one dinodex. Each of the at least one dinodex comprises a plurality of control lines and a plurality of data lines. The number of the plurality of control lines is expandable by reallocating one or more of the plurality of data lines to one or more control lines.
The foregoing has outlined rather broadly the features and technical advantages of the present invention in order that the detailed description of the invention that follows may be better understood. Additional features and advantages of the invention will be described hereinafter which form the subject of the claims of the invention.